﻿@model mscook.mvc.Models.ReadBaseModel

@if (Model.Magazine != null)
{
    <div class="recipes">
        <div class="span3 list" data-image-setting="Magazine">
            <div class="img">
                <a href="#">
                    <img src="@Url.Content("~/lazyload/grey.gif")" data-source="@Model.Magazine.ImageName" /></a>
            </div>
            <div class="mag_info1">
                <div class="mag_in_til">
                    <h4>
                        <a href="#">2013年10月刊</a>
                    </h4>
                    <p>
                        <span>简介：</span>
                        <span>@Model.Magazine.Title</span>
                    </p>
                </div>
                @if (Model.Magazine.ResourceBonusSetting == null || Model.Magazine.ResourceBonusSetting.Bonus == 0 || (Model.LoginUser != null && (Model.LoginUser.IsVip || Model.LoginUser.hasPurchased(Model.Magazine.Id))))
                {
                    <a class="s_but btn" href="@Url.Action("inner", "magazine", new { id = Model.Magazine.Id, year = Model.Magazine.Year, month = Model.Magazine.Volume })">在线阅读</a>
                }
                else
                {
                    if (Model.LoginUser == null)
                    {
                    <a href="#dialog-form-login" data-toggle="modal" class="s_but btn">登录后查看</a>
                    }
                    else
                    {
                    <a href="#" data-url="@Url.Action("inner", "magazine", new { id = Model.Magazine.Id, year = Model.Magazine.Year, month = Model.Magazine.Volume })" data-bonus="@Model.Magazine.AbsBonus" data-message="@Html.Encode("您确定要购买" + Model.Magazine.Year + "年" + Model.Magazine.Volume + "期")" data-resource="@Model.Magazine.Id" class="s_but btn needBonus">支付积分后查看</a>
                    }
                }


            </div>
        </div>
    </div>
}
